﻿<%@ Page Title="" Language="C#" MasterPageFile="~/TP3Master.master" AutoEventWireup="true" CodeFile="frmActivarServicio.aspx.cs" Inherits="Karaoke_Gestion_frmActivarServicio" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">

<script type ="text/javascript" language="javascript">
    var _source;

    var _popup;

    function showConfirm(source) {
        this._source = source;
        this._popup = $find('mdlPopup');

        this._popup.show();
    }

    function okClick() {
        //  find the confirm ModalPopup and hide it    
        this._popup.hide();
        //  use the cached button as the postback source
        __doPostBack(this._source.name, '');
    }

    function cancelClick() {
        //  find the confirm ModalPopup and hide it 
        this._popup.hide();
        //  clear the event source
        this._source = null;
        this._popup = null;
    }

    function cerrar() {

        document.getElementById('escritorio1').style.display = 'none';
        window.f_escritorio1.location.replace('');

    }

    function TestMensaje(valor) {

        document.getElementById('escritorio1').style.display = 'none';
        window.f_escritorio1.location.replace('');
        __doPostBack('prueba', '');

    }

</script>

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<div style="height:500px">
    

       <table width="60%" align="center"  cellpadding="4" cellspacing="1">
        <tr>
            <td align="left" class="filaCab" style="width: 40%;">
                <asp:Label ID="Label4" runat="server" Text="Listado de Mesas y Boxes" Font-Size="Larger"></asp:Label>
            </td>
        </tr>
     </table>
     <table width="60%" align="center"  cellpadding="4" cellspacing="1">
             <tr>
                <td align="right" style="width: 30%;">
                    <asp:Label ID="lblDatosUsuaio" runat="server"  Font-Size="X-Small" ForeColor="Green"></asp:Label>
                    <asp:Label ID="lblUserError" runat="server"  Font-Size="X-Small" ForeColor="Red"></asp:Label>
                </td>
            </tr>
     </table>

      <table width="40%" align="center"  cellpadding="4" cellspacing="1">
           <tr>
               <td style="height: 28px">
                        <asp:Label ID="lblDir" runat="server" Text="TIPO : " Font-Size="X-Small"></asp:Label>
                </td>
                 <td style="height: 28px">
                         <asp:DropDownList ID="ddlTipo" runat="server" 
                                    onselectedindexchanged="ddlTipo_SelectedIndexChanged" AutoPostBack="True">
                                <asp:ListItem Text="-- Seleccionar --" Value="-1"></asp:ListItem>
                                <asp:ListItem Text="Mesa" Value="2"></asp:ListItem>
                                <asp:ListItem Text="Box" Value="1"></asp:ListItem>
                                </asp:DropDownList>
                 </td>
           </tr>
       </table>
       <table width="40%" align="center"  cellpadding="4" cellspacing="1">
            <br />

             <tr>
                <td align="center">

                  <asp:UpdatePanel ID="upnLMesa" runat="server" UpdateMode="Conditional"  >
                    <ContentTemplate>

                        <asp:GridView ID="grvMesa" 
                                      runat="server" 
                                      DataKeyNames="NroMesa"  
                                      OnRowDataBound="grvMesa_RowDataBound"
                                      AlternatingRowStyle-CssClass="altrowstyle" 
                                         AllowPaging="True" 
                                         AutoGenerateColumns="False" 
                                         PageSize="5" 
                                         AllowSorting = "true"  
                                         Width="100%" 
                                         Font-Names="Arial" 
                                         Font-Size ="XX-Small" 
                                         BorderStyle="Inset"
                                         CellPadding="3" 
                                         CellSpacing="1" 
                                         GridLines="None" 
                                         BorderColor="Green"
                                         PagerSettings-PageButtonCount="10" 
                                         OnPageIndexChanging="grvMesa_GridView_PageIndexChanging">

                                  <SelectedRowStyle  BorderStyle="Solid" Font-Bold="True" />
				                 <HeaderStyle Font-Bold="True"  />
                                 <AlternatingRowStyle BackColor="White" />

                            <Columns>
                                <asp:BoundField DataField="NroMesa" HeaderText="Nro Mesa" />
                                <asp:BoundField DataField="strEstado" HeaderText="Estado" />
                                 <asp:TemplateField HeaderText="Estado"  >
                                    <ItemStyle  HorizontalAlign="Center"/>
                                    <ItemTemplate >
                                       <asp:ImageButton ID="btnActualizar" runat="server" CausesValidation="False"
                                                        OnClientClick="showConfirm(this); return false;"

                                            CommandName='<%# Bind("NroMesa") %>' Height="24px"  Text="Actualizar" 
                                            Width="24px" ImageUrl="~/Reclamos/img/imgVerDetalle.png" ToolTip="Actualizar" 
                                            OnCommand="actualizarMesa_OnClick" CommandArgument='<%# Bind("estado") %>' />
                               
                                    </ItemTemplate>
                                </asp:TemplateField>
                                
                            </Columns>
                            <PagerTemplate>
                                    &nbsp; &nbsp;
                                Pagina:
                    	            <%=grvMesa.PageIndex + 1%>
                                 de
                		            <%=grvMesa.PageCount%>
                                &nbsp;
                
                                <asp:Button ID="Button4" runat="server" CommandName="Page" ToolTip="Prim. Pag"  CommandArgument="First" CssClass="pagfirst" Visible="<%# grvMesa.PageIndex > 0%>"/>                    
                                <asp:Button ID="Button1" runat="server" CommandName="Page" ToolTip="Pág. anterior"  CommandArgument="Prev" CssClass="pagprev" Visible="<%# grvMesa.PageIndex > 0%>"/>
                                <asp:Button ID="Button2" runat="server" CommandName="Page" ToolTip="Sig. página" CommandArgument="Next" CssClass="pagnext" Visible="<%# Convert.ToBoolean(grvMesa.PageIndex + 1 - grvMesa.PageCount) %>"  />                    
                                <asp:Button ID="Button3" runat="server" CommandName="Page" ToolTip="Últ. Pag"  CommandArgument="Last" CssClass="paglast" Visible="<%# Convert.ToBoolean(grvMesa.PageIndex + 1 - grvMesa.PageCount) %>" />                    

                            </PagerTemplate>
                            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                            <SortedAscendingCellStyle BackColor="#FDF5AC" />
                            <SortedAscendingHeaderStyle BackColor="#4D0000" />
                            <SortedDescendingCellStyle BackColor="#FCF6C0" />
                            <SortedDescendingHeaderStyle BackColor="#820000" />
                        </asp:GridView>
                         <br />
                        <asp:Label ID="lblErrorAct" runat="server"  Font-Size="Small" ForeColor="Red"></asp:Label>
                        <asp:Label ID="lblExitoAct" runat="server"  Font-Size="Small" ForeColor="Green"></asp:Label>
                    </ContentTemplate>
                    
                </asp:UpdatePanel>


                <asp:UpdatePanel ID="updLBox" runat="server" UpdateMode="Conditional" 
                    ondatabinding="upnlArt_DataBinding">
                    <ContentTemplate>
                        <asp:GridView ID="grvBox" 
                                      runat="server" 
                                      DataKeyNames="NroBox" 
                                      OnRowDataBound="grvBox_RowDataBound"
                                      AlternatingRowStyle-CssClass="altrowstyle" 
                                         AllowPaging="True" 
                                         AutoGenerateColumns="False" 
                                         PageSize="5" 
                                         AllowSorting = "true"  
                                         Width="100%" 
                                         Font-Names="Arial" 
                                         Font-Size ="XX-Small" 
                                         BorderStyle="Inset"
                                         CellPadding="3" 
                                         CellSpacing="1" 
                                         GridLines="None" 
                                         BorderColor="Green"
                                         PagerSettings-PageButtonCount="10" 
                                         OnPageIndexChanging="grvBox_GridView_PageIndexChanging"
                                      >
                            <SelectedRowStyle  BorderStyle="Solid" Font-Bold="True" />
				                 <HeaderStyle Font-Bold="True"  />
                                 <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:BoundField DataField="Nrobox" HeaderText="Nro Mesa" />
                                <asp:BoundField DataField="Capacidad" HeaderText="Capacidad" />
                                <asp:BoundField DataField="strEstado" HeaderText="Estado" />
                               <asp:TemplateField HeaderText="Estado" >
                                    <ItemStyle  HorizontalAlign="Center"/>
                                    <ItemTemplate >
                                       <asp:ImageButton ID="btnActualizar" runat="server" CausesValidation="False" 
                                        OnClientClick="showConfirm(this); return false;"
                                            CommandName='<%# Bind("Nrobox") %>' Height="24px"  Text="Actualizar" 
                                            Width="24px" ImageUrl="~/Reclamos/img/imgVerDetalle.png" ToolTip="Actualizar" 
                                            OnCommand="actualizarBox_OnClick" CommandArgument='<%# Bind("estado") %>' />
                               
                                    </ItemTemplate>
                                </asp:TemplateField>
                                
                            </Columns>
                            <PagerTemplate>
                                    &nbsp; &nbsp;
                                Pagina:
                    	            <%=grvMesa.PageIndex + 1%>
                                 de
                		            <%=grvMesa.PageCount%>
                                &nbsp;
                
                                <asp:Button ID="Button4" runat="server" CommandName="Page" ToolTip="Prim. Pag"  CommandArgument="First" CssClass="pagfirst" Visible="<%# grvMesa.PageIndex > 0%>"/>                    
                                <asp:Button ID="Button1" runat="server" CommandName="Page" ToolTip="Pág. anterior"  CommandArgument="Prev" CssClass="pagprev" Visible="<%# grvMesa.PageIndex > 0%>"/>
                                <asp:Button ID="Button2" runat="server" CommandName="Page" ToolTip="Sig. página" CommandArgument="Next" CssClass="pagnext" Visible="<%# Convert.ToBoolean(grvMesa.PageIndex + 1 - grvMesa.PageCount) %>"  />                    
                                <asp:Button ID="Button3" runat="server" CommandName="Page" ToolTip="Últ. Pag"  CommandArgument="Last" CssClass="paglast" Visible="<%# Convert.ToBoolean(grvMesa.PageIndex + 1 - grvMesa.PageCount) %>" />                    

                            </PagerTemplate>
                            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                            <SortedAscendingCellStyle BackColor="#FDF5AC" />
                            <SortedAscendingHeaderStyle BackColor="#4D0000" />
                            <SortedDescendingCellStyle BackColor="#FCF6C0" />
                            <SortedDescendingHeaderStyle BackColor="#820000" />
                        </asp:GridView>
                         <br />
                        <asp:Label ID="lblErrBox" runat="server"  Font-Size="Small" ForeColor="Red"></asp:Label>
                        <asp:Label ID="lblExiBox" runat="server"  Font-Size="Small" ForeColor="Green"></asp:Label>

                    </ContentTemplate>
                    
                </asp:UpdatePanel>

                </td>
            </tr>

      </table>
    </div>

    <cc1:ModalPopupExtender ID="modalP"
    BehaviorID="mdlPopup" runat="server" 
    TargetControlID="div" PopupControlID="div" 
    OkControlID="btnOk" OnOkScript="okClick();" 
    CancelControlID="btnNo" OnCancelScript="cancelClick();" BackgroundCssClass="modalBackground" > </cc1:ModalPopupExtender>
        
      <div id="div" runat="server" align="center" class="confirm" style="display :none " >
                <table >
                <tr align="justify">
                   <td>
                       Actualizarará el registro. ¿Seguro de continuar?
                   </td>
                </tr>
                </table>
                <table><tr  align ="center">
                    <td style="width: 49px">
                     <asp:Button ID="btnOk" runat="server" Text="SI" Width="50px" /></td>
                    <td> <asp:Button ID="btnNo" runat="server" Text="NO" Width="50px" /></td></tr>
                </table>
    
      </div>

</asp:Content>

